Repository navigation
Conversation
…er checks the item The click and pointerup handlers decided on the release position only, and the pointerup consumed the recorded press before the click ran. A text selection started in the item and released over the check mark therefore toggled it. Keep the press of the gesture for its click and toggle only when it wasn't on the item's content. Signed-off-by: Ved Thakar <111605341+Vedthakar@users.noreply.github.com> Co-authored-by: Ved Thakar <111605341+Vedthakar@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vedthakar
force-pushed
the
fix/4861-checklist-drag-release
branch
from
October 21, 2026 21:37
012da9f to
fda47c9
Compare
Owner
Author
|
Superseded by meta#9429. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This solves issue meta#4861: a check list item gets checked when you select its text by dragging and release the mouse over its check box.
Current behavior. A drag that starts in the item's text and ends over the check mark still produces a
clickon the<li>, the nearest common ancestor of the press and the release.handleCheckItemEventdecides from that click's coordinates only, which are the release point, so the item toggles.The plugin already records what each press landed on (
lastPress:'checkMark','content'or'none') for its focus handling, but it can't be used as it stands. Thepointeruphandler runs before theclickand resetslastPressto'none'. By the time the click arrives, every real mouse gesture looks like a press-less click.What this changes.
pointeruphandler keeps the press of the gesture it ended (releasedPress) for the click that follows. It only does this for the primary button, since a right click has no click after it.clickand the touchpointeruppath toggle only when that press wasn't on the item's content:'none'(a click with no press behind it, such as one a screen reader synthesizes) still toggles;releasedPressis cleared by the click and by the next press, so it never carries over to a later gesture.This doesn't overlap with open PR meta#9106, which edits a different part of
checkList.ts(the Space handler).Closes meta#4861
Test plan
New tests in
packages/lexical-list/src/__tests__/unit/checkList.test.tsx, which already stubs the::beforewidth for jsdom. They dispatch full gestures:pointerdown/mousedown,pointerup/mouseup,click.The existing mobile tap and dedup tests in the file pass unchanged.
Before
On
mainwith the tests applied and the source change reverted:After
Author: Ved Thakar (@Vedthakar)